Headers, Defines and Globals

Owner: Everyone

Purpose and Documentation

The code here will define our global variables, the #define values we are using, and the global variables. To improve the readability of the code, consider if a global should actually be part of the Settings module before adding it here.

Code


//Includes
#include <p18f452.h>
 
//Defines
#define GRAMS 0
#define OUNCES 1
 
#define I_BUFSIZE 64
#define O_BUFSIZE 128
#define VBUFSIZE 24
#define X Y
 
//Global Variables
 
 
char recvbuf[I_BUFSIZE]; //All received commands are saved here (both serial and keypress), to be processed later
char transbuf[O_BUFSIZE]; //Output to the serial port is buffered here for the serial_transmit() to send
char dispbuf[O_BUFSIZE]; //Output to the LCD screen is buffered here for the LCD to display
char saybuf[O_BUFSIZE]; //Output to the speech module is buffered here for the speech module
 
unsigned int ADSamples[VBUFSIZE]; //Buffer of the N most recent voltage samples (in millivolts)
 
 
 
 
 
//Prototypes
void initialiseADConverter();
int getADValue();